<%-- 
    Document   : FrUser
    Created on : 20-11-2013, 04:49:35 PM
    Author     : Citt-2013
--%>

<%@page import="libreriaTicket.dao.DaoRegion"%>
<%@page import="libreriaTicket.entity.Region"%>
<%@page import="libreriaTicket.entity.Region"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Internet Dreams</title>

        <link href="publico/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">
            <link href="publico/css/bootstrap.css" rel="stylesheet" media="screen">
                <script src="publico/script/jquery.js" type="text/javascript"></script>
                <script src="publico/script/ajax.js" type="text/javascript"></script>
                <script src="publico/script/comuna.js" type="text/javascript"></script>
                </head>
                <%
                    String valor = (String) session.getAttribute("nombre");
                    if (valor != null) {
                %><jsp:include page="ingresado.jsp" flush="true"/><%                    } else {
                %><jsp:include page="menu.html" flush="true"/><%                        }
                %>
                <div class="container" style="width: 300px; padding-top: 150px">
                    <div class="left">
                        <div class="btn-group-vertical">
                            <a href="FrRegion.jsp"><button type="button" class="btn btn-default">Regiones</button></a>
                            <a href="FrComuna.jsp"><button type="button" class="btn btn-default">Comunas</button></a>
                            <a href="FrVerVentas.jsp"><button type="button" class="btn btn-default">Ventas</button></a>
                        </div>

                    </div>
                </div>
                <div class="container" style="width: 300px; padding-top: 150px" >
                    <form role="form" >
                        <div class="form-group">
                            <label>Nombre</label>
                            <input type="text" class="form-control" id="txtNombre" name="txtNombre" id="txtNombre"
                                   placeholder="nombre de la comuna"> </br>
                                <select id="cboRegion" name="cboRegion">
                                    <%
                                        ArrayList<Region> regiones = DaoRegion.sqlSelectAll();
                                        for (Region region : regiones) {
                                            out.write("<option value=\"" + region.getIdRegion() + "\">");
                                            out.write(region.getDescripcion());
                                            out.write("</option>");
                                        }
                                    %>
                                </select>
                        </div>
                        <button type="button" class="btn btn-default" name="btnRegistrar" id="btnRegistrar">Ingresar</button>
                    </form>
                </div>


                </body>
                </html>
